Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.

Module search - #7

Open
corinneroelli wants to merge 7 commits into
masterfrom
module-search
Open

Module search#7
corinneroelli wants to merge 7 commits into
masterfrom
module-search

Conversation

@corinneroelli

Copy link
Copy Markdown

@lejoe I didn't add the glass as a button. I think it would be the best having the search by typing.

closes #3

Comment thread src/modules/search/style.scss Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what those 3 lines are for.

you probably meant:

$i-spacing:        12px !default;

and then use $i-spacing / 2 and $i-spacing * 2

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why $i-spacing? I wanna use the variable for the padding in the input field and use it for the space between input field and icon. For me these are "general" spaces. Because of that I choosed a general variable. And added the variables on top that you know which thinks you need to define.
But I could add

$s:               $s;
$s-half:    0.5 * $s;
$s-double:    2 * $s;

If I change the variable in the settings it should change it everywhere in all modules. If I write

$i-spacing:        12px !default;

it doesn't.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment below.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lejoe If you have in the settings.scss this:

$i-spacing: $s;

and then in style.scss this:

$i-spacing:        12px !default;

You will overwrite the style definition from the settings. If you change then the variable $s in the settings it would not change in the module. Because in style.scss you will have 12px !default.
I wanted to avoid this.
And I still don't understand why the variable name should be $i-spacing? i for icon? it's not a icon space.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will overwrite the style definition from the settings. If you change then the variable $s in the settings it would not change in the module. Because in style.scss you will have 12px !default.

Have you tried it? it will not because of the !default.
You can read about it here: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#variable_defaults_

$i-spacing is better because what if suddenly you want something else that the regular spacing for the icons?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh... I didn't know that. Thats awesome! :)
ok, I agree having a new variable allows you having another space that the regular spacing. But usually I don't wanna have another space. The advantage of having a general variable (and multiple of this variable) is that you have a good overview over all spaces you are using in the project. and if you need another size you can just add i.e $s-third.
My problem is to understand when should I add a new variable and when not.
$i-spacing is used to define the space inside the input field (maybe the name means input-spacing and not icon-spacing)
but then you will use the same variable for the module form?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My problem is to understand when should I add a new variable and when not.

The rule of thumb is that if you want it really modular, each modules should use their own variables that you initialise in the settings file. That's the ideal world. Sometimes for simplicity and time reasons we don't do that and use "global" variables in modules like $c- or $l-gap- …

$i-spacing is used to define the space inside the input field (maybe the name means input-spacing and not icon-spacing)

Right it should be input spacing or even search-spacing.

but then you will use the same variable for the module form?

which module form?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no form module in this project. But if there would be a module form (i.e. to get in touch). There we need also an input-spacing. And I was wondering, if we would use then $i-spacing too (even there are two different modules)

@corinneroelli

Copy link
Copy Markdown
Author

@lejoe I renamed all variables which are only used in the module search:
renames spacing variable in commit a4c527c
renames icon styles variable in commit 5e44231
renames font color variable in commit 115e2ba

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Module: search

2 participants